From 07b603fa2fc4a3b980ac39ede97e221549cffdb1 Mon Sep 17 00:00:00 2001
From: KokaKiwi <kokakiwi+git@kokakiwi.net>
Date: Tue, 26 Sep 2023 14:52:25 +0200
Subject: [PATCH 1/2] fix(cmake): Fix when multiple .NET packages are installed

---
 cmake/modules/FindCoreClrEmbed.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmake/modules/FindCoreClrEmbed.cmake b/cmake/modules/FindCoreClrEmbed.cmake
index 9bcb6738..d18085e0 100644
--- a/cmake/modules/FindCoreClrEmbed.cmake
+++ b/cmake/modules/FindCoreClrEmbed.cmake
@@ -49,7 +49,8 @@ endif()
 set(CoreClrEmbed_ROOT_PATH "${CORECLR_RUNTIME_ROOT_PATH}")
 
 
-file(GLOB _CORECLR_HOST_ARCH_PATH "${CORECLR_RUNTIME_ROOT_PATH}/packs/Microsoft.NETCore.App.Host.*-${CORECLR_SUBARCH}")
+file(GLOB _CORECLR_HOST_ARCH_PATH_LIST "${CORECLR_RUNTIME_ROOT_PATH}/packs/Microsoft.NETCore.App.Host.*-${CORECLR_SUBARCH}")
+list(POP_FRONT _CORECLR_HOST_ARCH_PATH_LIST _CORECLR_HOST_ARCH_PATH)
 if (_CORECLR_HOST_ARCH_PATH)
     get_filename_component(_CORECLR_HOST_ARCH_FILENAME ${_CORECLR_HOST_ARCH_PATH} NAME)
     string(REPLACE "Microsoft.NETCore.App.Host." "" _CORECLR_COMPUTED_ARCH "${_CORECLR_HOST_ARCH_FILENAME}")
-- 
2.43.0

